package com.zerox.mapper;

import com.zerox.pojo.SysUser;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface SysUserMapper {
    SysUser login(@Param("login_name") String login_name, @Param("password") String password);

    List<SysUser> list(@Param("page") Integer page, @Param("limit") Integer limit);

    SysUser selectByUser_id(Integer user_id);

    @Update(" UPDATE `sys_user` SET `login_name` = #{login_name}, `user_name` = #{user_name}, `user_type` = #{user_type}, `phonenumber` = #{phonenumber}, `status` = #{status}, `create_time` = #{create_time} WHERE `user_id` = #{user_id}")
    int update(SysUser sysUser);

    int delete(Integer user_id);

    int add(SysUser sysUser);

    int statusUpdate(Integer id, Integer status);
    @Select("select count(*)from sys_user ")
    Integer count();
}
